const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const htmlWebpackPlugin = require('html-webpack-plugin')
module.exports={
	entry:path.join(__dirname,'./src/main.js'),
	output:{
		path:path.join(__dirname,'./dist'),
		filename:'bundle.js'
	},
	resolve:{
		alias:{//修改包的导入路径
			'vue$':'vue/dist/vue.js'
		}
	},
	plugins:[
		new VueLoaderPlugin(),
		new htmlWebpackPlugin({
			template:path.join(__dirname,'./src/index.html'),
			filename:'index.html'
		})
	
	],
	module:{
		rules:[
		{test:/\.css$/,use:['style-loader','css-loader']},
		{test:/\.jpg|png|gif|webp$/,use:'url-loader?limit=77399'},
		{test:/\.vue$/,use:'vue-loader'},
		{test:/\.ttf$/,use:'url-loader'},
		{test:/\.js$/,use:"babel-loader",exclude:/node_modules/}
		]
	}
}